package com._520it.crm.web.controller;

import com._520it.crm.page.PageResult;
import com._520it.crm.query.ClientQueryObject;
import com._520it.crm.service.IClientService;
import com._520it.crm.util.PermissionName;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by Administrator on 2017/10/14.
 */
@Controller
@RequestMapping("/potentialClient")
public class PotentialClientController {

    @Autowired
    IClientService clientService;

    @RequiresPermissions("potentialClient:index")
    @PermissionName("潜在客户列表")
    @RequestMapping("")
    public String index(){
        return "potentialClient";
    }

    @RequiresPermissions("potentialClient:list")
    @PermissionName("潜在客户数据")
    @RequestMapping("/list")
    @ResponseBody
    public PageResult list(ClientQueryObject qo){
        PageResult pageResult = null;
        qo.setClientStatus(0);
        pageResult = clientService.queryPage(qo);
        return pageResult;
    }
}
